package com.cn.stusy0015.demo0011;

/**
 * @author lw
 * @ClassName StrCount.java
 * @Description
 * @createTime 2023年05月20日 14:31:00
 */
public class StrCount {
    public int counters(String inputs, String word) {
        String[] str = new String[inputs.length()];
        int count = 0;
        for (int i = 0; i < inputs.length(); i++) {
            str[i] = inputs.substring(i, i+1);
            if (word.equals(str[i])){
                count++;
            }
        }
        return count;
    }
}
